package geditor {
import mx.collections.ArrayCollection;

public class CommonHelper {
    private static var _instance:CommonHelper = new CommonHelper();

    public static function get instance():CommonHelper {
        return _instance;
    }

    public function CommonHelper() {
    }

    public static function addItemToArray(arr:Array, item:Object, idx:int):Array {
        var tempArr:Array = arr.slice(0, idx);
        tempArr.push(item);
        return tempArr.concat(arr.slice(idx, arr.length));
    }

    public static function removeFromArray(arr:Array, idx:int):Array {
        return arr.slice(0, idx).concat(arr.slice(idx + 1, arr.length));
    }

    public static const emptyCollection:ArrayCollection = new ArrayCollection();
}
}